import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import router, { setupRouter } from "@/router";
import { initFunction } from "@/plugins/initFunction";
import { setElementIcon } from "@/plugins/setIcon";
import { setupStore } from "@/store";
import { setupProdMockServer } from "@/utils/mockProdServer.js";
import echarts from "@/echarts/index";
import Particles from "particles.vue3";
import { initI18n } from "@/i18n";
// import "normalize.css"
// setupProdMockServer()
async function appInit() {
  // 生产模式下使用mock
  // if(import.meta.env == "development") {
  // setupProdMockServer()
  // }
  const app = createApp(App);
  app.config.globalProperties.$echarts = echarts;
  app.config.performance = true;
  app.provide("$echarts", echarts);
  setElementIcon(app);
  setupStore(app);
  setupRouter(app);
  initI18n(app);
  await router.isReady();
  // app.use(Particles)
  app.mount("#app");
}
appInit().then(() => {
  initFunction();
});
